class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        for (int cur = -1, left = 0; left < nums.size(); left++) {
            if (nums[left] != 0)
                swap(nums[++cur], nums[left]);
        }
    }
};
